<template>
    <div>
        <img class="logo" src="https://element-plus.org/images/element-plus-logo.svg" alt="WMS">
    </div>
    <div>
      <el-dropdown @command="command">
        <span class="el-dropdown-link">
          <el-icon><UserFilled /></el-icon>
           {{store.nickName}}
            <el-icon class="el-icon--right">
              <arrow-down />
            </el-icon>
        </span>
        <template #dropdown>
            <el-dropdown-menu>
            <el-dropdown-item>用户信息</el-dropdown-item>
            <el-dropdown-item>会员中心</el-dropdown-item>
            <el-dropdown-item>订单管理</el-dropdown-item>
        <el-dropdown-item divided command="logout">注销</el-dropdown-item>
      </el-dropdown-menu>
    </template>
  </el-dropdown>
</div>
</template>
<script setup lang="ts">
import { wmsStore } from '@/store/pinia';
import { useRouter } from 'vue-router';
const router = useRouter()
let store = wmsStore();
const command = (lk:String) => {
  switch (lk) {
    case 'logout':
      store.token="",
      store.nickName="",
      router.push({ name: "user.login" })
      break;   
  }

}
</script >
<style scoped>
.logo{
    height: 40px;
}
.el-dropdown-link{
  outline: 0;
}
</style>